// 外部工具
export function getCurrentWeather({ location, unit = "celsius" }) {
  const weather_info = {
    location, // 查询的城市名称
    temperature: "22",
    unit, // 温度的单位（"celsius" 或 "fahrenheit"）
    forecast: ["晴朗 ☀️", "微风 🌬️"], // 天气简单的描述
  };

  return JSON.stringify(weather_info);
}

// 工具箱
export const tools = [
  {
    type: "function",
    function: {
      name: "getCurrentWeather",
      description: "获取指定城市当前的天气情况",
      parameters: {
        type: "object",
        properties: {
          location: {
            type: "string",
            description: "城市名称，例如：北京、上海、成都",
          },
          unit: {
            type: "string",
            enum: ["celsius", "fahrenheit"],
            description: "温度单位，可选：摄氏度或者华氏度",
          },
        },
        required: ["location"],
      },
    },
  },
];
